package com.neusoft.databus.core.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;

import com.neusoft.databus.common.enums.ResourceWorkMode;
import com.neusoft.databus.common.model.Resource;

/**
 * description
 *
 * @author sunchf
 * @date 2018年12月17日 下午2:08:07
 */
public interface ResourceRepository extends JpaRepository<Resource, Long>, CustomizedResourceRepository {

    Resource findByCode(String code);

    List<Resource> findByGateway_code(String gatewayCode);

    Resource findByIdAndGateway_workModeAndDisabled(Long id, ResourceWorkMode workMode, boolean disabled);

    long countByDisabled(boolean disabled);

    List<Resource> findByDisabledAndGateway_disabled(boolean disabled, boolean gatewayDisabled);

    List<Resource> findByAssociate(String associate);
}
